AWS X-Ray is a distributed tracing service that helps developers analyze and debug applications, particularly those built using microservices architecture. When integrated with AWS Lambda, X-Ray provides insights into function execution, including performance bottlenecks, downstream service calls, and end-to-end request tracing.
Tracks the full journey of a request through multiple AWS services.
Helps identify slow components, cold starts, or retry loops.
Visualizes the call graph with latency and status codes.
Assists in debugging by showing exceptions and response times.
Works well with Lambda functions triggered by API Gateway, S3, EventBridge, and others.
Enable 'Active tracing' in the Lambda function configuration.
Use the AWS SDK to annotate segments in your code for deeper visibility.
View traces and analytics in the AWS X-Ray console.
Ensure IAM roles grant xray:PutTraceSegments and xray:PutTelemetryRecords permissions.